<template>
  <div id="footMenu">
    <section
      @click="gotoAddress('/home')"
      class="menuItem"
      :class="$route.path.indexOf('home') !== -1? 'active' : 'no'"
    >
      <span>首页</span>
    </section>
    <section
      @click="gotoAddress('/city')"
      class="menuItem"
      :class="$route.path.indexOf('city') !== -1? 'active' : 'no'"
    >
      <span>城市</span>
    </section>
    <section
      @click="gotoAddress('/comment')"
      class="menuItem"
      :class="$route.path.indexOf('comment') !== -1? 'active' : 'no'"
    >
      <span>评价</span>
    </section>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },

  methods: {
    gotoAddress(path) {
      this.$router.push(path);
    }
  }
};
</script>

<style lang="scss" scoped>
@import "../style/mixin";
#footMenu {
  background-color: #fff;
  position: fixed;
  z-index: 100;
  left: 0;
  right: 0;
  bottom: 0;
  @include wh(100%, 1.95rem);
  display: flex;
  box-shadow: 0 -0.026667rem 0.053333rem rgba(0, 0, 0, 0.1);
}
.menuItem {
  flex: 1;
  display: flex;
  text-align: center;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  span {
    @include sc(0.65rem, #666);
  }
}
.menuItem.active {
  span {
    @include sc(0.65rem, rgb(11, 117, 85));
  }
}
</style>

